<template>
	<div id="financialAudit">
		<navAndBanner></navAndBanner>
		<div class="img1">

		</div>
		<div style="height:1px;border-top:3px solid #7ecef4;width:76.4%;margin:0 auto;"></div>
		<div class="title">
			<p><span style="font-size:24px">未审核酒卡—</span>双击酒卡记录可打开酒卡进行审核</p>
		</div>
		<div style="width:965px;margin:0 auto;margin-top:25px">
			<Table border :columns="columns4" :data="savelist" @on-row-dblclick="getinfo"></Table>
		</div>
		<div style="width:965px;margin:0 auto;font-size:24px;margin-top:35px;color:#afafaf">
			数量:<span>{{i}}</span>
		</div>
		<div class="footer">
			<p>kqmts   &copy 2015-2017 All Rights Reserved</p>
			<p>川ICP备16020686号</p>
		</div>
	</div>
</template>
<script>
	import navAndBanner from '../navAndBanner.vue'
	export default {
		components:{
			navAndBanner
		},
		data(){
			return{
				columns4: [
                    
                    {
                        title: '序列',
                        key: 'XL',
                        width:100
                    },
                    {
                        title: '酒卡号',
                        key: 'CJKH'
                    },
                    {
                        title: '业务日期',
                        key: 'CJRQ'
                    },
                    {
                        title: '状态',
                        key: 'STATE'
                    },
                    {
                        title: '建卡人',
                        key: 'LR'
                    }
                ],
				savelist:[],
				i:""
			}
		},
		mounted(){
			this.userinfo = JSON.parse(sessionStorage.userinfo).data
			//获取存酒单列表
			var _this = this
			this.$http.post(`${this.URL}/api/ws/storage_list`,{
				token:_this.userinfo.token,
				userid:_this.userinfo.YHBM,
				timestamp:new Date().getTime()
			})
			.then(function  (res) {
				// body... 
				console.log(res)
				if (res.data.error_code == 0 ) {
					_this.i = res.data.data.length
					for (var i = res.data.data.length - 1; i >= 0; i--) {
						res.data.data[i].XL = i+1;
						if (res.data.data[i].STATE == 1) {
							res.data.data[i].STATE = "可用"
						}
						else{
							res.data.data[i].STATE = "不可用"
						}
						if (res.data.data[i].SH == "已审核") {
							
							res.data.data.splice(i,1)
						}
						
					}
					
					_this.savelist = res.data.data
				}
			})
		},
		methods:{
			getinfo:function(info){
				info = JSON.stringify(info)
				sessionStorage.wshJiuKaInfo = info
				this.$router.push("/cunjiuFunc/audit")
			}
		}
	}
</script>
<style scoped>
	.title{
		width:965px;
		height: 45px;
		border-bottom: 1px solid;
		margin: 0 auto;
		margin-top: 70px
	}
	.img1{
		background: url(../../assets/img/Title4.png);
		width: 438px;
		height: 69px;
		margin:0 auto;
		margin-top: 90px;margin-bottom: 80px;
	}
	.navAndBanner{
		background:linear-gradient(30deg,#b490ca,#5ebbe7);
		width: 100%;
		height: 120px;
		vertical-align: middle;
		padding-top: 40px
		
	}
	a{
		text-decoration: none;
	}
	nav ul li{
		display: inline-block;
		vertical-align: middle;
		margin-right: 5%
	}
	nav ul li a{
		font-size: 24px;
		color: #999999;
	}
	nav ul li:first-child{
		margin-left: 13%;
		margin-right: 15%;
	}
	nav ul li:last-child{
		margin-top: 12px;
		float: right
		
	}
	body{background-color: #1E1E1E}
	*{padding:0;margin: 0;list-style:none;font-family: "微软雅黑";}
	.footer{
		height: 125px;
		width: 100%;
		background:linear-gradient(30deg,#b490ca,#5ebbe7);
		text-align: center;
		vertical-align: middle;
		color: white;
		padding-top: 50px;
		margin-top: 125px
	}
</style>